package top.ninwoo.utils.util;

import top.ninwoo.common.entity.DockerContainer;

import java.util.Map;

/**
 * @Author joliu
 * @Description docker 的工具接口
 * @Date　Create in 下午9:21 2019/10/20
 */
public interface DockerUtils {

    /**
     * @description docker ps
     * @return
     */
    Map<String, DockerContainer> getContainers();

    /**
     * @description docker ps -a
     * @return
     */
    Map<String, DockerContainer> getContainers(boolean isAll);

    /**
     * @description docker run -itd --name [name] [image] [cmd]
     * @param container
     * @return
     */
    DockerContainer runDocker(DockerContainer container);

    DockerContainer getDockerById(String id);

    boolean deleteDockerById(String id);

    String execInDocker(String containerId, String args);

    String execInDocker(String containerId, String... args);

    boolean startContainer(String containerId);

    String getDockerIdByName(String name);
}
